## Table A1: Effects of Neighborhood Race and Income on Wait Times: Controlling for Unmeasured Need

## install.packages(c("tidyverse", "fixest"))
## library(tidyverse)

## SET WORKING DIRECTORY HERE
## setwd()

## Loading data
## load("dta.RData")

## Column 1
race_wait_across_controls <- feols(log_wait_time ~ factor(white_third) + I(log(distance)) + I(log(pop_per_sq_mi)) + NatWalkInd |
                                     city^ open_month^open_year, cluster = "geo", data = dta)

## Column 2
race_wait_within_controls <- feols(log_wait_time ~ factor(white_third) + I(log(distance)) + I(log(pop_per_sq_mi)) + NatWalkInd |
                                     city_service^ open_month^open_year, cluster = "geo", data = dta)

## Column 3
inc_wait_across_controls <- feols(log_wait_time ~ factor(inc_third) + I(log(distance)) + I(log(pop_per_sq_mi)) + NatWalkInd |
                                    city^ open_month^open_year, cluster = "geo", data = dta)

## Column 4
inc_wait_within_controls <- feols(log_wait_time ~ factor(inc_third) + I(log(distance)) + I(log(pop_per_sq_mi)) + NatWalkInd |
                                    city_service^ open_month^open_year, cluster = "geo", data = dta)


TableA1 = etable(race_wait_across_controls, race_wait_within_controls,
                 inc_wait_across_controls, inc_wait_within_controls,
                 signifCode = c("+" = 0.10, "*" = 0.05, "**" = 0.01, "***" = 0.001),
                 digits = 3, digits.stats = 3, fitstat =c("n","r2"))